package com.guigu.guliauth.feign;

import com.guigu.gulicommon.entity.dto.RegisterByGiteeDto;
import com.guigu.gulicommon.entity.pojo.res.Res;
import com.guigu.gulicommon.entity.vo.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 会员服务会员相关远程调用客户端
 * @author 陈俊杰
 */
@FeignClient(name = "member-server", path = "/member/ums-member")
public interface MemberServer {
    /**
     * 根据用户名和密码获取用户信息
     *
     * @param userName 用户名
     * @param password 密码
     * @return 用户信息
     */
    @GetMapping("/getUserByUserNameAndPassword")
    Res<UserInfoVo> getUserByUserNameAndPassword(@RequestParam(value = "userName") String userName, @RequestParam(value = "password") String password);

    /**
     * 根据用户名查询用户信息
     * @param userName 用户名
     * @return 用户信息
     */
    @GetMapping("/existsByUserName")
    Res<UserInfoVo> existsByUserName(@RequestParam(value = "userName") String userName);

    @GetMapping("/registerByGitee")
    Res<UserInfoVo> registerByGitee(@RequestBody RegisterByGiteeDto dto);
}
